-   case: default_manager_create_is_typechecked
    main: |
        from myapp.models import User
        User.objects.create(pk=1, name='Max', age=10)
        User.objects.create(age=[])  # E: Incompatible type for "age" of "User" (got "List[Any]", expected "Union[float, int, str, Combinable]")
    installed_apps:
        - myapp
    files:
        -   path: myapp/__init__.py
        -   path: myapp/models.py
            content: |
                from django.db import models

                class User(models.Model):
                    name = models.CharField(max_length=100)
                    age = models.IntegerField()

-   case: model_recognises_parent_attributes
    main: |
        from myapp.models import Child
        Child.objects.create(name='Maxim', lastname='Maxim2')
    installed_apps:
        - myapp
    files:
        -   path: myapp/__init__.py
        -   path: myapp/models.py
            content: |
                from django.db import models

                class Parent(models.Model):
                    name = models.CharField(max_length=100)
                class Child(Parent):
                    lastname = models.CharField(max_length=100)

-   case: deep_multiple_inheritance_with_create
    main: |
        from myapp.models import Child4
        Child4.objects.create(name1='n1', name2='n2', value=1, value4=4)
    installed_apps:
        - myapp
    files:
        -   path: myapp/__init__.py
        -   path: myapp/models.py
            content: |
                from django.db import models

                class Parent1(models.Model):
                    name1 = models.CharField(max_length=50)
                class Parent2(models.Model):
                    id2 = models.AutoField(primary_key=True)
                    name2 = models.CharField(max_length=50)

                class Child1(Parent1, Parent2):
                    value = models.IntegerField()
                class Child4(Child1):
                    value4 = models.IntegerField()

-   case: optional_id_fields_for_create_is_error_if_not_autofield
    main: |
        from myapp.models import Publisher, Book

        Book.objects.create(id=None)  # E: Incompatible type for "id" of "Book" (got "None", expected "Union[float, int, str, Combinable]")
        Book.objects.create(publisher=None)  # E: Incompatible type for "publisher" of "Book" (got "None", expected "Union[Publisher, Combinable]")
        Book.objects.create(publisher_id=None)  # E: Incompatible type for "publisher_id" of "Book" (got "None", expected "Union[Combinable, int, str]")
    installed_apps:
        - myapp
    files:
        -   path: myapp/__init__.py
        -   path: myapp/models.py
            content: |
                from django.db import models
                class Publisher(models.Model):
                    pass
                class Book(models.Model):
                    id = models.IntegerField(primary_key=True)
                    publisher = models.ForeignKey(Publisher, on_delete=models.CASCADE)

-   case: none_for_primary_key_is_allowed_if_field_is_autogenerated
    main: |
        from myapp.models import Book
        Book.objects.create(id=None)
    installed_apps:
        - myapp
    files:
        -   path: myapp/__init__.py
        -   path: myapp/models.py
            content: |
                from django.db import models
                class Book(models.Model):
                    pass

-   case: when_default_for_primary_key_is_specified_allow_none_to_be_set
    main: |
        from myapp.models import MyModel
        MyModel(id=None)
        MyModel.objects.create(id=None)

        from myapp.models import MyModel2
        MyModel2(id=None)
        MyModel2.objects.create(id=None)  # E: Incompatible type for "id" of "MyModel2" (got "None", expected "Union[float, int, str, Combinable]")
    installed_apps:
        - myapp
    files:
        -   path: myapp/__init__.py
        -   path: myapp/models.py
            content: |
                from django.db import models
                def return_int():
                    return 0
                class MyModel(models.Model):
                    id = models.IntegerField(primary_key=True, default=return_int)
                class MyModel2(models.Model):
                    id = models.IntegerField(primary_key=True)
